package STUDENT.TRANNGUYENQUAN.OOPs.OBJECT_AND_CLASSES.Octagon;

import java.util.Scanner;

public class Views {

	public static void main(String[] args) {
		String str = "";
		Octagon oct = new Octagon();
		Models model = new Models();
		OctagonControllers controller = new OctagonControllers();
		Scanner sc;
		do {
			System.out.println("Nhap vao gia tri 1 canh cua bat giac: ");
			sc = new Scanner(System.in);
			String temp = sc.nextLine();
			if (temp.isEmpty()) {
				System.out.println("Ban chua nhap canh thu nhat!");
			} else {
				str = temp;
			}
		} while (str.isEmpty());
		oct.setSide(Double.parseDouble(str));
		if(controller.Check(oct)){
			System.out.println("Chu vi cua hinh bat giac la: "+model.Perimeter(oct));
			System.out.println("Dien tich cua hinh bat giac la: "+model.Area(oct));
		}else{
			System.out.println("Gia tri cua canh nhap vao chua dung, gia tri cua canh phai lon hon hoac bang 1!");
		}
	}

}
